{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'refresh_token': '25.cae98042077e514a5113eda7ffcb42db.315360000.1910274803.282335-21427456', 'expires_in': 2592000, 'session_key': '9mzdCrO2sH2ksRSBrAa9Oclee+K5A7zwqfKLRNGbkqhrT2oIhXA4WdMrRAUj0ARtF8rgRIQ7rb+Qat3IZcTWtSl+FYRC6w==', 'access_token': '24.17f01e1fce926a0c56f44e80734b0f24.2592000.1597506803.282335-21427456', 'scope': 'public vis-classify_dishes vis-classify_car brain_all_scope vis-classify_animal vis-classify_plant brain_object_detect brain_realtime_logo brain_dish_detect brain_car_detect brain_animal_classify brain_plant_classify brain_ingredient brain_advanced_general_classify brain_custom_dish brain_poi_recognize brain_vehicle_detect brain_redwine brain_currency brain_vehicle_damage wise_adapt lebo_resource_base lightservice_public hetu_basic lightcms_map_poi kaidian_kaidian ApsMisTest_Test权限 vis-classify_flower lpq_开放 cop_helloScope ApsMis_fangdi_permission smartapp_snsapi_base iop_autocar oauth_tp_app smartapp_smart_game_openapi oauth_sessionkey smartapp_swanid_verify smartapp_opensource_openapi smartapp_opensource_recapi fake_face_detect_开放Scope vis-ocr_虚拟人物助理 idl-video_虚拟人物助理', 'session_secret': 'b7c7ff834240fc240d01e228a6ba0c0e'}\n"
     ]
    }
   ],
   "source": [
    "# encoding:utf-8\n",
    "#获取token\n",
    "import requests \n",
    "\n",
    "# client_id 为官网获取的AK， client_secret 为官网获取的SK\n",
    "host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=【官网获取的AK】&client_secret=【官网获取的SK】'\n",
    "response = requests.get(host)\n",
    "if response:\n",
    "    print(response.json())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 果蔬识别"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 图片显示\n",
    "![蔬菜](https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594926604314&di=6e02fb3f02a91d26b546b2b5d207a821&imgtype=0&src=http%3A%2F%2Fimg13.360buyimg.com%2Fn1%2Fjfs%2Ft4141%2F69%2F351575720%2F323555%2Fccd9008%2F58b3c601Na4f13da4.jpg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'log_id': 8069199660929034929, 'result_num': 5, 'result': [{'score': 0.9809007048606873, 'name': '菠菜'}, {'score': 0.012932092882692814, 'name': '菜心'}, {'score': 0.001699418993666768, 'name': '芥兰'}, {'score': 0.0013180120149627328, 'name': '雪里红'}, {'score': 0.0010101088555529714, 'name': '青菜'}]}\n"
     ]
    }
   ],
   "source": [
    "# encoding:utf-8\n",
    "\n",
    "import requests\n",
    "import base64\n",
    "\n",
    "'''\n",
    "细粒度图像识别\n",
    "'''\n",
    "\n",
    "request_url = \"https://aip.baidubce.com/rest/2.0/image-classify/v1/classify/ingredient\"\n",
    "# 二进制方式打开图片文件\n",
    "f = open('[本地文件]', 'rb')\n",
    "img = base64.b64encode(f.read())\n",
    "\n",
    "params = {\"image\":img}\n",
    "access_token = '[调用鉴权接口获取的token]'\n",
    "request_url = request_url + \"?access_token=\" + access_token\n",
    "headers = {'content-type': 'application/x-www-form-urlencoded'}\n",
    "response = requests.post(request_url, data=params, headers=headers)\n",
    "if response:\n",
    "    print (response.json())\n",
    "results = response.json()\n",
    "df = pd.json_normalize(results)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>score</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.980901</td>\n",
       "      <td>菠菜</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.012932</td>\n",
       "      <td>菜心</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.001699</td>\n",
       "      <td>芥兰</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.001318</td>\n",
       "      <td>雪里红</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.001010</td>\n",
       "      <td>青菜</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      score name\n",
       "0  0.980901   菠菜\n",
       "1  0.012932   菜心\n",
       "2  0.001699   芥兰\n",
       "3  0.001318  雪里红\n",
       "4  0.001010   青菜"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#结果显示\n",
    "df2=pd.json_normalize(df['result'][0])\n",
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 菜品识别"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 图片显示\n",
    "![蔬菜](https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594926921337&di=83937e0bfd5294ba37458b8ca5361b41&imgtype=0&src=http%3A%2F%2Fm.5h.com%2Fd%2Ffile%2F20170417%2F1492399483246978.jpg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'log_id': 2082097563989081201, 'result_num': 5, 'result': [{'calorie': '164', 'has_calorie': True, 'name': '果仁菠菜', 'probability': '0.317453'}, {'calorie': '111', 'has_calorie': True, 'name': '菜桃仁', 'probability': '0.206529'}, {'calorie': '28', 'has_calorie': True, 'name': '菠菜', 'probability': '0.170867'}, {'calorie': '79', 'has_calorie': True, 'name': '大拌菜', 'probability': '0.0957858'}, {'calorie': '195', 'has_calorie': True, 'name': '炒鸡蛋', 'probability': '0.0321466'}]}\n"
     ]
    }
   ],
   "source": [
    "# encoding:utf-8\n",
    "\n",
    "import requests\n",
    "import base64\n",
    "\n",
    "'''\n",
    "菜品识别\n",
    "'''\n",
    "\n",
    "request_url = \"https://aip.baidubce.com/rest/2.0/image-classify/v2/dish\"\n",
    "# 二进制方式打开图片文件\n",
    "f = open('[本地文件]', 'rb')\n",
    "img = base64.b64encode(f.read())\n",
    "\n",
    "params = {\"image\":img,\"top_num\":5}\n",
    "access_token = '[调用鉴权接口获取的token]'\n",
    "request_url = request_url + \"?access_token=\" + access_token\n",
    "headers = {'content-type': 'application/x-www-form-urlencoded'}\n",
    "response2 = requests.post(request_url, data=params, headers=headers)\n",
    "if response2:\n",
    "    print (response2.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "caipin = pd.json_normalize(response2.json())\n",
    "df3=pd.json_normalize(caipin['result'][0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>calorie</th>\n",
       "      <th>has_calorie</th>\n",
       "      <th>name</th>\n",
       "      <th>probability</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>164</td>\n",
       "      <td>True</td>\n",
       "      <td>果仁菠菜</td>\n",
       "      <td>0.317453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>111</td>\n",
       "      <td>True</td>\n",
       "      <td>菜桃仁</td>\n",
       "      <td>0.206529</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>28</td>\n",
       "      <td>True</td>\n",
       "      <td>菠菜</td>\n",
       "      <td>0.170867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>79</td>\n",
       "      <td>True</td>\n",
       "      <td>大拌菜</td>\n",
       "      <td>0.0957858</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>195</td>\n",
       "      <td>True</td>\n",
       "      <td>炒鸡蛋</td>\n",
       "      <td>0.0321466</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  calorie  has_calorie  name probability\n",
       "0     164         True  果仁菠菜    0.317453\n",
       "1     111         True   菜桃仁    0.206529\n",
       "2      28         True    菠菜    0.170867\n",
       "3      79         True   大拌菜   0.0957858\n",
       "4     195         True   炒鸡蛋   0.0321466"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "keyword=df3['name'][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import urllib,sys\n",
    "import ssl\n",
    "import urllib.request\n",
    "\n",
    "keyword='keyword'\n",
    "host = 'https://jisusrecipe.market.alicloudapi.com'\n",
    "path = '/recipe/search'\n",
    "method = 'GET'\n",
    "appcode = '***'\n",
    "querys = 'keyword=%E7%99%BD%E8%8F%9C&num=10&start=0'\n",
    "bodys = {}\n",
    "url = host + path + '?' + querys\n",
    "\n",
    "request = urllib.request.urlopen(url)\n",
    "request.add_header('Authorization', 'APPCODE ' + appcode)\n",
    "ctx = ssl.create_default_context()\n",
    "ctx.check_hostname = False\n",
    "ctx.verify_mode = ssl.CERT_NONE\n",
    "response = urllib.urlopen(request, context=ctx)\n",
    "content = response.read()\n",
    "if (content):\n",
    "    print(content)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = {\"status\":0,\"msg\":\"ok\",\"result\":{\"total\":3,\"num\":3,\"list\":[{\"id\":9183,\"classid\":44,\"name\":\"果仁菠菜\",\"peoplenum\":\"1-2人\",\"preparetime\":\"无\",\"cookingtime\":\"10-20分钟\",\"content\":\"果仁菠菜养生保健棒棒哒\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160719\\/133609_41190.jpg\",\"tag\":\"健脑益智,润肠通便,生津止渴,缓解压力\",\"material\":[{\"mname\":\"\",\"type\":0,\"amount\":\"\"},{\"mname\":\"菠菜\",\"type\":1,\"amount\":\"500g\"},{\"mname\":\"花生米\",\"type\":1,\"amount\":\"80g\"},{\"mname\":\"陈醋\",\"type\":1,\"amount\":\"10ml\"},{\"mname\":\"白糖\",\"type\":1,\"amount\":\"15g\"},{\"mname\":\"盐\",\"type\":1,\"amount\":\"1g\"},{\"mname\":\"蒜末\",\"type\":1,\"amount\":\"20g\"},{\"mname\":\"香油\",\"type\":1,\"amount\":\"3滴\"}],\"process\":[{\"pcontent\":\"准备食材，菠菜去根洗净，蒜辫拍碎，花生米和其它调味料备齐\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092522_28647.jpg\"},{\"pcontent\":\"热锅凉油煸熟花生米岀香味段生捞出\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092522_24659.jpg\"},{\"pcontent\":\"锅中放入清水，水开焯菠菜捞出过凉水（焯水菠菜去除草酸）\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092523_81987.jpg\"},{\"pcontent\":\"然后菠菜利干水份切寸段，花生米放入碗中\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092523_20267.jpg\"},{\"pcontent\":\"菠菜，蒜末，陈醋，盐，糖和香油放盆中\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092523_67765.jpg\"},{\"pcontent\":\"在倒入花生米拌匀（后放花生米更脆）\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092524_19711.jpg\"},{\"pcontent\":\"拌匀放入碗中压实\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092524_57448.jpg\"},{\"pcontent\":\"扣上个盘，在倒扣过来去掉碗\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092524_48301.jpg\"},{\"pcontent\":\"撒少许白芝麻盐即可（没有白芝麻可以省略）\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160801\\/092524_59527.jpg\"}]},{\"id\":20367,\"classid\":187,\"name\":\"果仁菠菜\",\"peoplenum\":\"3-4人\",\"preparetime\":\"10分钟内\",\"cookingtime\":\"10-20分钟\",\"content\":\"这道菜是在朋友的生日宴会上吃过的，觉的味道不错，是我喜欢的口味。刚好买了核桃、腰果，今天也就模仿试做一下，非常成功，女儿说和饭店的味道一样呢。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160719\\/162350_96997.jpg\",\"tag\":\"阳虚质,原味,炒,秋季,家常,尿频,健脾养胃,炒锅\",\"material\":[{\"mname\":\"油\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"盐\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"味精\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"芝麻油\",\"type\":0,\"amount\":\"1勺\"},{\"mname\":\"菠菜\",\"type\":1,\"amount\":\"400g\"},{\"mname\":\"核桃\",\"type\":1,\"amount\":\"50g\"},{\"mname\":\"腰果\",\"type\":1,\"amount\":\"50g\"}],\"process\":[{\"pcontent\":\"准备食材\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103551_14965.jpg\"},{\"pcontent\":\"核桃仁放热水中浸泡10分钟后，去皮。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103551_16963.jpg\"},{\"pcontent\":\"菠菜去黄叶洗净待用\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103551_63536.jpg\"},{\"pcontent\":\"锅中热水放入菠菜氽水，去涩捞出。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103551_40140.jpg\"},{\"pcontent\":\"菠菜晾凉后切5厘米长的段。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103552_80510.jpg\"},{\"pcontent\":\"锅内倒入油，同时倒入腰果、核桃用小火翻炒。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103552_60693.jpg\"},{\"pcontent\":\"待腰果、核桃炒至微变黄色时\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103556_24762.jpg\"},{\"pcontent\":\"放入氽好的菠菜翻炒。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103556_89963.jpg\"},{\"pcontent\":\"放入一匙芝麻油增香。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103557_65155.jpg\"},{\"pcontent\":\"放入盐调味。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103557_88188.jpg\"},{\"pcontent\":\"放入少许味精拌均匀即可。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160802\\/103558_68738.jpg\"}]},{\"id\":45062,\"classid\":461,\"name\":\"果仁菠菜\",\"peoplenum\":\"1-2人\",\"preparetime\":\"10分钟内\",\"cookingtime\":\"10-20分钟\",\"content\":\"果仁菠菜虽然做法简单，但却是我们这里很经典的小菜。一般酒楼、饭庄等，用餐上菜之前都会来几碟小菜，其中大都有果仁菠菜。一般大多数都是用蒜末调味，今天我用洋葱，洋葱生吃是最好的，非常有益健康。所以，拌小菜，我都选择用洋葱调味，味道也非常棒呢。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160720\\/101424_18430.jpg\",\"tag\":\"凉菜,开胃,拌,焯\",\"material\":[{\"mname\":\"油炸花生\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"盐\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"一品鲜酱油\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"味素\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"醋\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"糖\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"洋葱\",\"type\":0,\"amount\":\"适量\"},{\"mname\":\"菠菜\",\"type\":1,\"amount\":\"200g\"}],\"process\":[{\"pcontent\":\"菠菜摘洗干净。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124017_90592.jpg\"},{\"pcontent\":\"烧开水烫熟。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124017_11730.jpg\"},{\"pcontent\":\"捞出晾凉。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124017_84162.jpg\"},{\"pcontent\":\"洋葱切丝。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124017_71683.jpg\"},{\"pcontent\":\"油炸花生备好。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124017_58014.jpg\"},{\"pcontent\":\"焯熟的菠菜、洋葱、花生放在一起。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124017_12812.jpg\"},{\"pcontent\":\"加上适当的盐、酱油、糖、醋、味精。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124018_51324.jpg\"},{\"pcontent\":\"拌匀即可。\",\"pic\":\"http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/20160806\\/124021_84802.jpg\"}]}]}}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"status\": 0, \"msg\": \"ok\", \"result\": {\"total\": 3, \"num\": 3, \"list\": [{\"id\": 9183, \"classid\": 44, \"name\": \"\\u679c\\u4ec1\\u83e0\\u83dc\", \"peoplenum\": \"1-2\\u4eba\", \"preparetime\": \"\\u65e0\", \"cookingtime\": \"10-20\\u5206\\u949f\", \"content\": \"\\u679c\\u4ec1\\u83e0\\u83dc\\u517b\\u751f\\u4fdd\\u5065\\u68d2\\u68d2\\u54d2\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/133609_41190.jpg\", \"tag\": \"\\u5065\\u8111\\u76ca\\u667a,\\u6da6\\u80a0\\u901a\\u4fbf,\\u751f\\u6d25\\u6b62\\u6e34,\\u7f13\\u89e3\\u538b\\u529b\", \"material\": [{\"mname\": \"\", \"type\": 0, \"amount\": \"\"}, {\"mname\": \"\\u83e0\\u83dc\", \"type\": 1, \"amount\": \"500g\"}, {\"mname\": \"\\u82b1\\u751f\\u7c73\", \"type\": 1, \"amount\": \"80g\"}, {\"mname\": \"\\u9648\\u918b\", \"type\": 1, \"amount\": \"10ml\"}, {\"mname\": \"\\u767d\\u7cd6\", \"type\": 1, \"amount\": \"15g\"}, {\"mname\": \"\\u76d0\", \"type\": 1, \"amount\": \"1g\"}, {\"mname\": \"\\u849c\\u672b\", \"type\": 1, \"amount\": \"20g\"}, {\"mname\": \"\\u9999\\u6cb9\", \"type\": 1, \"amount\": \"3\\u6ef4\"}], \"process\": [{\"pcontent\": \"\\u51c6\\u5907\\u98df\\u6750\\uff0c\\u83e0\\u83dc\\u53bb\\u6839\\u6d17\\u51c0\\uff0c\\u849c\\u8fab\\u62cd\\u788e\\uff0c\\u82b1\\u751f\\u7c73\\u548c\\u5176\\u5b83\\u8c03\\u5473\\u6599\\u5907\\u9f50\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092522_28647.jpg\"}, {\"pcontent\": \"\\u70ed\\u9505\\u51c9\\u6cb9\\u7178\\u719f\\u82b1\\u751f\\u7c73\\u5c80\\u9999\\u5473\\u6bb5\\u751f\\u635e\\u51fa\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092522_24659.jpg\"}, {\"pcontent\": \"\\u9505\\u4e2d\\u653e\\u5165\\u6e05\\u6c34\\uff0c\\u6c34\\u5f00\\u712f\\u83e0\\u83dc\\u635e\\u51fa\\u8fc7\\u51c9\\u6c34\\uff08\\u712f\\u6c34\\u83e0\\u83dc\\u53bb\\u9664\\u8349\\u9178\\uff09\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_81987.jpg\"}, {\"pcontent\": \"\\u7136\\u540e\\u83e0\\u83dc\\u5229\\u5e72\\u6c34\\u4efd\\u5207\\u5bf8\\u6bb5\\uff0c\\u82b1\\u751f\\u7c73\\u653e\\u5165\\u7897\\u4e2d\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_20267.jpg\"}, {\"pcontent\": \"\\u83e0\\u83dc\\uff0c\\u849c\\u672b\\uff0c\\u9648\\u918b\\uff0c\\u76d0\\uff0c\\u7cd6\\u548c\\u9999\\u6cb9\\u653e\\u76c6\\u4e2d\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_67765.jpg\"}, {\"pcontent\": \"\\u5728\\u5012\\u5165\\u82b1\\u751f\\u7c73\\u62cc\\u5300\\uff08\\u540e\\u653e\\u82b1\\u751f\\u7c73\\u66f4\\u8106\\uff09\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_19711.jpg\"}, {\"pcontent\": \"\\u62cc\\u5300\\u653e\\u5165\\u7897\\u4e2d\\u538b\\u5b9e\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_57448.jpg\"}, {\"pcontent\": \"\\u6263\\u4e0a\\u4e2a\\u76d8\\uff0c\\u5728\\u5012\\u6263\\u8fc7\\u6765\\u53bb\\u6389\\u7897\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_48301.jpg\"}, {\"pcontent\": \"\\u6492\\u5c11\\u8bb8\\u767d\\u829d\\u9ebb\\u76d0\\u5373\\u53ef\\uff08\\u6ca1\\u6709\\u767d\\u829d\\u9ebb\\u53ef\\u4ee5\\u7701\\u7565\\uff09\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_59527.jpg\"}]}, {\"id\": 20367, \"classid\": 187, \"name\": \"\\u679c\\u4ec1\\u83e0\\u83dc\", \"peoplenum\": \"3-4\\u4eba\", \"preparetime\": \"10\\u5206\\u949f\\u5185\", \"cookingtime\": \"10-20\\u5206\\u949f\", \"content\": \"\\u8fd9\\u9053\\u83dc\\u662f\\u5728\\u670b\\u53cb\\u7684\\u751f\\u65e5\\u5bb4\\u4f1a\\u4e0a\\u5403\\u8fc7\\u7684\\uff0c\\u89c9\\u7684\\u5473\\u9053\\u4e0d\\u9519\\uff0c\\u662f\\u6211\\u559c\\u6b22\\u7684\\u53e3\\u5473\\u3002\\u521a\\u597d\\u4e70\\u4e86\\u6838\\u6843\\u3001\\u8170\\u679c\\uff0c\\u4eca\\u5929\\u4e5f\\u5c31\\u6a21\\u4eff\\u8bd5\\u505a\\u4e00\\u4e0b\\uff0c\\u975e\\u5e38\\u6210\\u529f\\uff0c\\u5973\\u513f\\u8bf4\\u548c\\u996d\\u5e97\\u7684\\u5473\\u9053\\u4e00\\u6837\\u5462\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/162350_96997.jpg\", \"tag\": \"\\u9633\\u865a\\u8d28,\\u539f\\u5473,\\u7092,\\u79cb\\u5b63,\\u5bb6\\u5e38,\\u5c3f\\u9891,\\u5065\\u813e\\u517b\\u80c3,\\u7092\\u9505\", \"material\": [{\"mname\": \"\\u6cb9\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u76d0\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u5473\\u7cbe\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u829d\\u9ebb\\u6cb9\", \"type\": 0, \"amount\": \"1\\u52fa\"}, {\"mname\": \"\\u83e0\\u83dc\", \"type\": 1, \"amount\": \"400g\"}, {\"mname\": \"\\u6838\\u6843\", \"type\": 1, \"amount\": \"50g\"}, {\"mname\": \"\\u8170\\u679c\", \"type\": 1, \"amount\": \"50g\"}], \"process\": [{\"pcontent\": \"\\u51c6\\u5907\\u98df\\u6750\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_14965.jpg\"}, {\"pcontent\": \"\\u6838\\u6843\\u4ec1\\u653e\\u70ed\\u6c34\\u4e2d\\u6d78\\u6ce110\\u5206\\u949f\\u540e\\uff0c\\u53bb\\u76ae\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_16963.jpg\"}, {\"pcontent\": \"\\u83e0\\u83dc\\u53bb\\u9ec4\\u53f6\\u6d17\\u51c0\\u5f85\\u7528\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_63536.jpg\"}, {\"pcontent\": \"\\u9505\\u4e2d\\u70ed\\u6c34\\u653e\\u5165\\u83e0\\u83dc\\u6c3d\\u6c34\\uff0c\\u53bb\\u6da9\\u635e\\u51fa\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_40140.jpg\"}, {\"pcontent\": \"\\u83e0\\u83dc\\u667e\\u51c9\\u540e\\u52075\\u5398\\u7c73\\u957f\\u7684\\u6bb5\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_80510.jpg\"}, {\"pcontent\": \"\\u9505\\u5185\\u5012\\u5165\\u6cb9\\uff0c\\u540c\\u65f6\\u5012\\u5165\\u8170\\u679c\\u3001\\u6838\\u6843\\u7528\\u5c0f\\u706b\\u7ffb\\u7092\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_60693.jpg\"}, {\"pcontent\": \"\\u5f85\\u8170\\u679c\\u3001\\u6838\\u6843\\u7092\\u81f3\\u5fae\\u53d8\\u9ec4\\u8272\\u65f6\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_24762.jpg\"}, {\"pcontent\": \"\\u653e\\u5165\\u6c3d\\u597d\\u7684\\u83e0\\u83dc\\u7ffb\\u7092\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_89963.jpg\"}, {\"pcontent\": \"\\u653e\\u5165\\u4e00\\u5319\\u829d\\u9ebb\\u6cb9\\u589e\\u9999\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_65155.jpg\"}, {\"pcontent\": \"\\u653e\\u5165\\u76d0\\u8c03\\u5473\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_88188.jpg\"}, {\"pcontent\": \"\\u653e\\u5165\\u5c11\\u8bb8\\u5473\\u7cbe\\u62cc\\u5747\\u5300\\u5373\\u53ef\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103558_68738.jpg\"}]}, {\"id\": 45062, \"classid\": 461, \"name\": \"\\u679c\\u4ec1\\u83e0\\u83dc\", \"peoplenum\": \"1-2\\u4eba\", \"preparetime\": \"10\\u5206\\u949f\\u5185\", \"cookingtime\": \"10-20\\u5206\\u949f\", \"content\": \"\\u679c\\u4ec1\\u83e0\\u83dc\\u867d\\u7136\\u505a\\u6cd5\\u7b80\\u5355\\uff0c\\u4f46\\u5374\\u662f\\u6211\\u4eec\\u8fd9\\u91cc\\u5f88\\u7ecf\\u5178\\u7684\\u5c0f\\u83dc\\u3002\\u4e00\\u822c\\u9152\\u697c\\u3001\\u996d\\u5e84\\u7b49\\uff0c\\u7528\\u9910\\u4e0a\\u83dc\\u4e4b\\u524d\\u90fd\\u4f1a\\u6765\\u51e0\\u789f\\u5c0f\\u83dc\\uff0c\\u5176\\u4e2d\\u5927\\u90fd\\u6709\\u679c\\u4ec1\\u83e0\\u83dc\\u3002\\u4e00\\u822c\\u5927\\u591a\\u6570\\u90fd\\u662f\\u7528\\u849c\\u672b\\u8c03\\u5473\\uff0c\\u4eca\\u5929\\u6211\\u7528\\u6d0b\\u8471\\uff0c\\u6d0b\\u8471\\u751f\\u5403\\u662f\\u6700\\u597d\\u7684\\uff0c\\u975e\\u5e38\\u6709\\u76ca\\u5065\\u5eb7\\u3002\\u6240\\u4ee5\\uff0c\\u62cc\\u5c0f\\u83dc\\uff0c\\u6211\\u90fd\\u9009\\u62e9\\u7528\\u6d0b\\u8471\\u8c03\\u5473\\uff0c\\u5473\\u9053\\u4e5f\\u975e\\u5e38\\u68d2\\u5462\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160720\\\\/101424_18430.jpg\", \"tag\": \"\\u51c9\\u83dc,\\u5f00\\u80c3,\\u62cc,\\u712f\", \"material\": [{\"mname\": \"\\u6cb9\\u70b8\\u82b1\\u751f\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u76d0\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u4e00\\u54c1\\u9c9c\\u9171\\u6cb9\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u5473\\u7d20\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u918b\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u7cd6\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u6d0b\\u8471\", \"type\": 0, \"amount\": \"\\u9002\\u91cf\"}, {\"mname\": \"\\u83e0\\u83dc\", \"type\": 1, \"amount\": \"200g\"}], \"process\": [{\"pcontent\": \"\\u83e0\\u83dc\\u6458\\u6d17\\u5e72\\u51c0\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_90592.jpg\"}, {\"pcontent\": \"\\u70e7\\u5f00\\u6c34\\u70eb\\u719f\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_11730.jpg\"}, {\"pcontent\": \"\\u635e\\u51fa\\u667e\\u51c9\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_84162.jpg\"}, {\"pcontent\": \"\\u6d0b\\u8471\\u5207\\u4e1d\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_71683.jpg\"}, {\"pcontent\": \"\\u6cb9\\u70b8\\u82b1\\u751f\\u5907\\u597d\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_58014.jpg\"}, {\"pcontent\": \"\\u712f\\u719f\\u7684\\u83e0\\u83dc\\u3001\\u6d0b\\u8471\\u3001\\u82b1\\u751f\\u653e\\u5728\\u4e00\\u8d77\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_12812.jpg\"}, {\"pcontent\": \"\\u52a0\\u4e0a\\u9002\\u5f53\\u7684\\u76d0\\u3001\\u9171\\u6cb9\\u3001\\u7cd6\\u3001\\u918b\\u3001\\u5473\\u7cbe\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124018_51324.jpg\"}, {\"pcontent\": \"\\u62cc\\u5300\\u5373\\u53ef\\u3002\", \"pic\": \"http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124021_84802.jpg\"}]}]}}\n",
      "<class 'module'>\n",
      "{'status': 0, 'msg': 'ok', 'result': {'total': 3, 'num': 3, 'list': [{'id': 9183, 'classid': 44, 'name': '果仁菠菜', 'peoplenum': '1-2人', 'preparetime': '无', 'cookingtime': '10-20分钟', 'content': '果仁菠菜养生保健棒棒哒', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/133609_41190.jpg', 'tag': '健脑益智,润肠通便,生津止渴,缓解压力', 'material': [{'mname': '', 'type': 0, 'amount': ''}, {'mname': '菠菜', 'type': 1, 'amount': '500g'}, {'mname': '花生米', 'type': 1, 'amount': '80g'}, {'mname': '陈醋', 'type': 1, 'amount': '10ml'}, {'mname': '白糖', 'type': 1, 'amount': '15g'}, {'mname': '盐', 'type': 1, 'amount': '1g'}, {'mname': '蒜末', 'type': 1, 'amount': '20g'}, {'mname': '香油', 'type': 1, 'amount': '3滴'}], 'process': [{'pcontent': '准备食材，菠菜去根洗净，蒜辫拍碎，花生米和其它调味料备齐', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092522_28647.jpg'}, {'pcontent': '热锅凉油煸熟花生米岀香味段生捞出', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092522_24659.jpg'}, {'pcontent': '锅中放入清水，水开焯菠菜捞出过凉水（焯水菠菜去除草酸）', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_81987.jpg'}, {'pcontent': '然后菠菜利干水份切寸段，花生米放入碗中', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_20267.jpg'}, {'pcontent': '菠菜，蒜末，陈醋，盐，糖和香油放盆中', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_67765.jpg'}, {'pcontent': '在倒入花生米拌匀（后放花生米更脆）', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_19711.jpg'}, {'pcontent': '拌匀放入碗中压实', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_57448.jpg'}, {'pcontent': '扣上个盘，在倒扣过来去掉碗', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_48301.jpg'}, {'pcontent': '撒少许白芝麻盐即可（没有白芝麻可以省略）', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_59527.jpg'}]}, {'id': 20367, 'classid': 187, 'name': '果仁菠菜', 'peoplenum': '3-4人', 'preparetime': '10分钟内', 'cookingtime': '10-20分钟', 'content': '这道菜是在朋友的生日宴会上吃过的，觉的味道不错，是我喜欢的口味。刚好买了核桃、腰果，今天也就模仿试做一下，非常成功，女儿说和饭店的味道一样呢。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/162350_96997.jpg', 'tag': '阳虚质,原味,炒,秋季,家常,尿频,健脾养胃,炒锅', 'material': [{'mname': '油', 'type': 0, 'amount': '适量'}, {'mname': '盐', 'type': 0, 'amount': '适量'}, {'mname': '味精', 'type': 0, 'amount': '适量'}, {'mname': '芝麻油', 'type': 0, 'amount': '1勺'}, {'mname': '菠菜', 'type': 1, 'amount': '400g'}, {'mname': '核桃', 'type': 1, 'amount': '50g'}, {'mname': '腰果', 'type': 1, 'amount': '50g'}], 'process': [{'pcontent': '准备食材', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_14965.jpg'}, {'pcontent': '核桃仁放热水中浸泡10分钟后，去皮。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_16963.jpg'}, {'pcontent': '菠菜去黄叶洗净待用', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_63536.jpg'}, {'pcontent': '锅中热水放入菠菜氽水，去涩捞出。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_40140.jpg'}, {'pcontent': '菠菜晾凉后切5厘米长的段。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_80510.jpg'}, {'pcontent': '锅内倒入油，同时倒入腰果、核桃用小火翻炒。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_60693.jpg'}, {'pcontent': '待腰果、核桃炒至微变黄色时', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_24762.jpg'}, {'pcontent': '放入氽好的菠菜翻炒。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_89963.jpg'}, {'pcontent': '放入一匙芝麻油增香。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_65155.jpg'}, {'pcontent': '放入盐调味。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_88188.jpg'}, {'pcontent': '放入少许味精拌均匀即可。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103558_68738.jpg'}]}, {'id': 45062, 'classid': 461, 'name': '果仁菠菜', 'peoplenum': '1-2人', 'preparetime': '10分钟内', 'cookingtime': '10-20分钟', 'content': '果仁菠菜虽然做法简单，但却是我们这里很经典的小菜。一般酒楼、饭庄等，用餐上菜之前都会来几碟小菜，其中大都有果仁菠菜。一般大多数都是用蒜末调味，今天我用洋葱，洋葱生吃是最好的，非常有益健康。所以，拌小菜，我都选择用洋葱调味，味道也非常棒呢。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160720\\\\/101424_18430.jpg', 'tag': '凉菜,开胃,拌,焯', 'material': [{'mname': '油炸花生', 'type': 0, 'amount': '适量'}, {'mname': '盐', 'type': 0, 'amount': '适量'}, {'mname': '一品鲜酱油', 'type': 0, 'amount': '适量'}, {'mname': '味素', 'type': 0, 'amount': '适量'}, {'mname': '醋', 'type': 0, 'amount': '适量'}, {'mname': '糖', 'type': 0, 'amount': '适量'}, {'mname': '洋葱', 'type': 0, 'amount': '适量'}, {'mname': '菠菜', 'type': 1, 'amount': '200g'}], 'process': [{'pcontent': '菠菜摘洗干净。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_90592.jpg'}, {'pcontent': '烧开水烫熟。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_11730.jpg'}, {'pcontent': '捞出晾凉。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_84162.jpg'}, {'pcontent': '洋葱切丝。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_71683.jpg'}, {'pcontent': '油炸花生备好。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_58014.jpg'}, {'pcontent': '焯熟的菠菜、洋葱、花生放在一起。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_12812.jpg'}, {'pcontent': '加上适当的盐、酱油、糖、醋、味精。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124018_51324.jpg'}, {'pcontent': '拌匀即可。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124021_84802.jpg'}]}]}}\n",
      "<class 'dict'>\n",
      "{'status': 0, 'msg': 'ok', 'result': {'total': 3, 'num': 3, 'list': [{'id': 9183, 'classid': 44, 'name': '果仁菠菜', 'peoplenum': '1-2人', 'preparetime': '无', 'cookingtime': '10-20分钟', 'content': '果仁菠菜养生保健棒棒哒', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/133609_41190.jpg', 'tag': '健脑益智,润肠通便,生津止渴,缓解压力', 'material': [{'mname': '', 'type': 0, 'amount': ''}, {'mname': '菠菜', 'type': 1, 'amount': '500g'}, {'mname': '花生米', 'type': 1, 'amount': '80g'}, {'mname': '陈醋', 'type': 1, 'amount': '10ml'}, {'mname': '白糖', 'type': 1, 'amount': '15g'}, {'mname': '盐', 'type': 1, 'amount': '1g'}, {'mname': '蒜末', 'type': 1, 'amount': '20g'}, {'mname': '香油', 'type': 1, 'amount': '3滴'}], 'process': [{'pcontent': '准备食材，菠菜去根洗净，蒜辫拍碎，花生米和其它调味料备齐', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092522_28647.jpg'}, {'pcontent': '热锅凉油煸熟花生米岀香味段生捞出', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092522_24659.jpg'}, {'pcontent': '锅中放入清水，水开焯菠菜捞出过凉水（焯水菠菜去除草酸）', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_81987.jpg'}, {'pcontent': '然后菠菜利干水份切寸段，花生米放入碗中', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_20267.jpg'}, {'pcontent': '菠菜，蒜末，陈醋，盐，糖和香油放盆中', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092523_67765.jpg'}, {'pcontent': '在倒入花生米拌匀（后放花生米更脆）', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_19711.jpg'}, {'pcontent': '拌匀放入碗中压实', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_57448.jpg'}, {'pcontent': '扣上个盘，在倒扣过来去掉碗', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_48301.jpg'}, {'pcontent': '撒少许白芝麻盐即可（没有白芝麻可以省略）', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160801\\\\/092524_59527.jpg'}]}, {'id': 20367, 'classid': 187, 'name': '果仁菠菜', 'peoplenum': '3-4人', 'preparetime': '10分钟内', 'cookingtime': '10-20分钟', 'content': '这道菜是在朋友的生日宴会上吃过的，觉的味道不错，是我喜欢的口味。刚好买了核桃、腰果，今天也就模仿试做一下，非常成功，女儿说和饭店的味道一样呢。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/162350_96997.jpg', 'tag': '阳虚质,原味,炒,秋季,家常,尿频,健脾养胃,炒锅', 'material': [{'mname': '油', 'type': 0, 'amount': '适量'}, {'mname': '盐', 'type': 0, 'amount': '适量'}, {'mname': '味精', 'type': 0, 'amount': '适量'}, {'mname': '芝麻油', 'type': 0, 'amount': '1勺'}, {'mname': '菠菜', 'type': 1, 'amount': '400g'}, {'mname': '核桃', 'type': 1, 'amount': '50g'}, {'mname': '腰果', 'type': 1, 'amount': '50g'}], 'process': [{'pcontent': '准备食材', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_14965.jpg'}, {'pcontent': '核桃仁放热水中浸泡10分钟后，去皮。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_16963.jpg'}, {'pcontent': '菠菜去黄叶洗净待用', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_63536.jpg'}, {'pcontent': '锅中热水放入菠菜氽水，去涩捞出。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_40140.jpg'}, {'pcontent': '菠菜晾凉后切5厘米长的段。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_80510.jpg'}, {'pcontent': '锅内倒入油，同时倒入腰果、核桃用小火翻炒。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_60693.jpg'}, {'pcontent': '待腰果、核桃炒至微变黄色时', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_24762.jpg'}, {'pcontent': '放入氽好的菠菜翻炒。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_89963.jpg'}, {'pcontent': '放入一匙芝麻油增香。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_65155.jpg'}, {'pcontent': '放入盐调味。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_88188.jpg'}, {'pcontent': '放入少许味精拌均匀即可。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103558_68738.jpg'}]}, {'id': 45062, 'classid': 461, 'name': '果仁菠菜', 'peoplenum': '1-2人', 'preparetime': '10分钟内', 'cookingtime': '10-20分钟', 'content': '果仁菠菜虽然做法简单，但却是我们这里很经典的小菜。一般酒楼、饭庄等，用餐上菜之前都会来几碟小菜，其中大都有果仁菠菜。一般大多数都是用蒜末调味，今天我用洋葱，洋葱生吃是最好的，非常有益健康。所以，拌小菜，我都选择用洋葱调味，味道也非常棒呢。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160720\\\\/101424_18430.jpg', 'tag': '凉菜,开胃,拌,焯', 'material': [{'mname': '油炸花生', 'type': 0, 'amount': '适量'}, {'mname': '盐', 'type': 0, 'amount': '适量'}, {'mname': '一品鲜酱油', 'type': 0, 'amount': '适量'}, {'mname': '味素', 'type': 0, 'amount': '适量'}, {'mname': '醋', 'type': 0, 'amount': '适量'}, {'mname': '糖', 'type': 0, 'amount': '适量'}, {'mname': '洋葱', 'type': 0, 'amount': '适量'}, {'mname': '菠菜', 'type': 1, 'amount': '200g'}], 'process': [{'pcontent': '菠菜摘洗干净。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_90592.jpg'}, {'pcontent': '烧开水烫熟。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_11730.jpg'}, {'pcontent': '捞出晾凉。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_84162.jpg'}, {'pcontent': '洋葱切丝。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_71683.jpg'}, {'pcontent': '油炸花生备好。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_58014.jpg'}, {'pcontent': '焯熟的菠菜、洋葱、花生放在一起。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_12812.jpg'}, {'pcontent': '加上适当的盐、酱油、糖、醋、味精。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124018_51324.jpg'}, {'pcontent': '拌匀即可。', 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124021_84802.jpg'}]}]}}\n"
     ]
    }
   ],
   "source": [
    "import json\n",
    " \n",
    "jsonStr = json.dumps(data)  #python数据结构(一般为字典)转换为JSON编码的字符串\n",
    "print(jsonStr)\n",
    "print(type(json))\n",
    "data2 = json.loads(jsonStr) #将一个JSON编码的字符串转换回一个python数据结构\n",
    "print(data2)\n",
    "print(type(data2))\n",
    "#我们现在试着写入json类型数据\n",
    "with open(\"my_data.json\",'w') as f:\n",
    "    json.dump(data2,f)\n",
    " \n",
    "#我们现在进行读入json类型数据\n",
    "with open(\"my_data.json\",'r') as g:\n",
    "    result_data = json.load(g)\n",
    "\n",
    "print(result_data)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': 20367,\n",
       " 'classid': 187,\n",
       " 'name': '果仁菠菜',\n",
       " 'peoplenum': '3-4人',\n",
       " 'preparetime': '10分钟内',\n",
       " 'cookingtime': '10-20分钟',\n",
       " 'content': '这道菜是在朋友的生日宴会上吃过的，觉的味道不错，是我喜欢的口味。刚好买了核桃、腰果，今天也就模仿试做一下，非常成功，女儿说和饭店的味道一样呢。',\n",
       " 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/162350_96997.jpg',\n",
       " 'tag': '阳虚质,原味,炒,秋季,家常,尿频,健脾养胃,炒锅',\n",
       " 'material': [{'mname': '油', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '盐', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '味精', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '芝麻油', 'type': 0, 'amount': '1勺'},\n",
       "  {'mname': '菠菜', 'type': 1, 'amount': '400g'},\n",
       "  {'mname': '核桃', 'type': 1, 'amount': '50g'},\n",
       "  {'mname': '腰果', 'type': 1, 'amount': '50g'}],\n",
       " 'process': [{'pcontent': '准备食材',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_14965.jpg'},\n",
       "  {'pcontent': '核桃仁放热水中浸泡10分钟后，去皮。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_16963.jpg'},\n",
       "  {'pcontent': '菠菜去黄叶洗净待用',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_63536.jpg'},\n",
       "  {'pcontent': '锅中热水放入菠菜氽水，去涩捞出。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_40140.jpg'},\n",
       "  {'pcontent': '菠菜晾凉后切5厘米长的段。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_80510.jpg'},\n",
       "  {'pcontent': '锅内倒入油，同时倒入腰果、核桃用小火翻炒。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_60693.jpg'},\n",
       "  {'pcontent': '待腰果、核桃炒至微变黄色时',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_24762.jpg'},\n",
       "  {'pcontent': '放入氽好的菠菜翻炒。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_89963.jpg'},\n",
       "  {'pcontent': '放入一匙芝麻油增香。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_65155.jpg'},\n",
       "  {'pcontent': '放入盐调味。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_88188.jpg'},\n",
       "  {'pcontent': '放入少许味精拌均匀即可。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103558_68738.jpg'}]}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df4 = pd.read_json('my_data.json',lines=True)\n",
    "df4['result'][0]['list'][0]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': 20367,\n",
       " 'classid': 187,\n",
       " 'name': '果仁菠菜',\n",
       " 'peoplenum': '3-4人',\n",
       " 'preparetime': '10分钟内',\n",
       " 'cookingtime': '10-20分钟',\n",
       " 'content': '这道菜是在朋友的生日宴会上吃过的，觉的味道不错，是我喜欢的口味。刚好买了核桃、腰果，今天也就模仿试做一下，非常成功，女儿说和饭店的味道一样呢。',\n",
       " 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160719\\\\/162350_96997.jpg',\n",
       " 'tag': '阳虚质,原味,炒,秋季,家常,尿频,健脾养胃,炒锅',\n",
       " 'material': [{'mname': '油', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '盐', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '味精', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '芝麻油', 'type': 0, 'amount': '1勺'},\n",
       "  {'mname': '菠菜', 'type': 1, 'amount': '400g'},\n",
       "  {'mname': '核桃', 'type': 1, 'amount': '50g'},\n",
       "  {'mname': '腰果', 'type': 1, 'amount': '50g'}],\n",
       " 'process': [{'pcontent': '准备食材',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_14965.jpg'},\n",
       "  {'pcontent': '核桃仁放热水中浸泡10分钟后，去皮。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_16963.jpg'},\n",
       "  {'pcontent': '菠菜去黄叶洗净待用',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_63536.jpg'},\n",
       "  {'pcontent': '锅中热水放入菠菜氽水，去涩捞出。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103551_40140.jpg'},\n",
       "  {'pcontent': '菠菜晾凉后切5厘米长的段。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_80510.jpg'},\n",
       "  {'pcontent': '锅内倒入油，同时倒入腰果、核桃用小火翻炒。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103552_60693.jpg'},\n",
       "  {'pcontent': '待腰果、核桃炒至微变黄色时',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_24762.jpg'},\n",
       "  {'pcontent': '放入氽好的菠菜翻炒。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103556_89963.jpg'},\n",
       "  {'pcontent': '放入一匙芝麻油增香。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_65155.jpg'},\n",
       "  {'pcontent': '放入盐调味。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103557_88188.jpg'},\n",
       "  {'pcontent': '放入少许味精拌均匀即可。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160802\\\\/103558_68738.jpg'}]}"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df4['result'][0]['list'][1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': 45062,\n",
       " 'classid': 461,\n",
       " 'name': '果仁菠菜',\n",
       " 'peoplenum': '1-2人',\n",
       " 'preparetime': '10分钟内',\n",
       " 'cookingtime': '10-20分钟',\n",
       " 'content': '果仁菠菜虽然做法简单，但却是我们这里很经典的小菜。一般酒楼、饭庄等，用餐上菜之前都会来几碟小菜，其中大都有果仁菠菜。一般大多数都是用蒜末调味，今天我用洋葱，洋葱生吃是最好的，非常有益健康。所以，拌小菜，我都选择用洋葱调味，味道也非常棒呢。',\n",
       " 'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160720\\\\/101424_18430.jpg',\n",
       " 'tag': '凉菜,开胃,拌,焯',\n",
       " 'material': [{'mname': '油炸花生', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '盐', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '一品鲜酱油', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '味素', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '醋', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '糖', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '洋葱', 'type': 0, 'amount': '适量'},\n",
       "  {'mname': '菠菜', 'type': 1, 'amount': '200g'}],\n",
       " 'process': [{'pcontent': '菠菜摘洗干净。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_90592.jpg'},\n",
       "  {'pcontent': '烧开水烫熟。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_11730.jpg'},\n",
       "  {'pcontent': '捞出晾凉。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_84162.jpg'},\n",
       "  {'pcontent': '洋葱切丝。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_71683.jpg'},\n",
       "  {'pcontent': '油炸花生备好。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_58014.jpg'},\n",
       "  {'pcontent': '焯熟的菠菜、洋葱、花生放在一起。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124017_12812.jpg'},\n",
       "  {'pcontent': '加上适当的盐、酱油、糖、醋、味精。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124018_51324.jpg'},\n",
       "  {'pcontent': '拌匀即可。',\n",
       "   'pic': 'http:\\\\/\\\\/api.jisuapi.com\\\\/recipe\\\\/upload\\\\/20160806\\\\/124021_84802.jpg'}]}"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df4['result'][0]['list'][2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#提取第一道菜的菜谱信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "df5=pd.json_normalize(df4['result'][0]['list'][0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>classid</th>\n",
       "      <th>name</th>\n",
       "      <th>peoplenum</th>\n",
       "      <th>preparetime</th>\n",
       "      <th>cookingtime</th>\n",
       "      <th>content</th>\n",
       "      <th>pic</th>\n",
       "      <th>tag</th>\n",
       "      <th>material</th>\n",
       "      <th>process</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9183</td>\n",
       "      <td>44</td>\n",
       "      <td>果仁菠菜</td>\n",
       "      <td>1-2人</td>\n",
       "      <td>无</td>\n",
       "      <td>10-20分钟</td>\n",
       "      <td>果仁菠菜养生保健棒棒哒</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "      <td>健脑益智,润肠通便,生津止渴,缓解压力</td>\n",
       "      <td>[{'mname': '', 'type': 0, 'amount': ''}, {'mna...</td>\n",
       "      <td>[{'pcontent': '准备食材，菠菜去根洗净，蒜辫拍碎，花生米和其它调味料备齐', ...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     id  classid  name peoplenum preparetime cookingtime      content  \\\n",
       "0  9183       44  果仁菠菜      1-2人           无     10-20分钟  果仁菠菜养生保健棒棒哒   \n",
       "\n",
       "                                                 pic                  tag  \\\n",
       "0  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  健脑益智,润肠通便,生津止渴,缓解压力   \n",
       "\n",
       "                                            material  \\\n",
       "0  [{'mname': '', 'type': 0, 'amount': ''}, {'mna...   \n",
       "\n",
       "                                             process  \n",
       "0  [{'pcontent': '准备食材，菠菜去根洗净，蒜辫拍碎，花生米和其它调味料备齐', ...  "
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df5\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...\n",
       "Name: pic, dtype: object"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df5['pic']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>mname</th>\n",
       "      <th>type</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td></td>\n",
       "      <td>0</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>菠菜</td>\n",
       "      <td>1</td>\n",
       "      <td>500g</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>花生米</td>\n",
       "      <td>1</td>\n",
       "      <td>80g</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>陈醋</td>\n",
       "      <td>1</td>\n",
       "      <td>10ml</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>白糖</td>\n",
       "      <td>1</td>\n",
       "      <td>15g</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>盐</td>\n",
       "      <td>1</td>\n",
       "      <td>1g</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>蒜末</td>\n",
       "      <td>1</td>\n",
       "      <td>20g</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>香油</td>\n",
       "      <td>1</td>\n",
       "      <td>3滴</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  mname  type amount\n",
       "0           0       \n",
       "1    菠菜     1   500g\n",
       "2   花生米     1    80g\n",
       "3    陈醋     1   10ml\n",
       "4    白糖     1    15g\n",
       "5     盐     1     1g\n",
       "6    蒜末     1    20g\n",
       "7    香油     1     3滴"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#所需材料\n",
    "pd.json_normalize(df5['material'][0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pcontent</th>\n",
       "      <th>pic</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>准备食材，菠菜去根洗净，蒜辫拍碎，花生米和其它调味料备齐</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>热锅凉油煸熟花生米岀香味段生捞出</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>锅中放入清水，水开焯菠菜捞出过凉水（焯水菠菜去除草酸）</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>然后菠菜利干水份切寸段，花生米放入碗中</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>菠菜，蒜末，陈醋，盐，糖和香油放盆中</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>在倒入花生米拌匀（后放花生米更脆）</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>拌匀放入碗中压实</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>扣上个盘，在倒扣过来去掉碗</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>撒少许白芝麻盐即可（没有白芝麻可以省略）</td>\n",
       "      <td>http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       pcontent  \\\n",
       "0  准备食材，菠菜去根洗净，蒜辫拍碎，花生米和其它调味料备齐   \n",
       "1              热锅凉油煸熟花生米岀香味段生捞出   \n",
       "2   锅中放入清水，水开焯菠菜捞出过凉水（焯水菠菜去除草酸）   \n",
       "3           然后菠菜利干水份切寸段，花生米放入碗中   \n",
       "4            菠菜，蒜末，陈醋，盐，糖和香油放盆中   \n",
       "5             在倒入花生米拌匀（后放花生米更脆）   \n",
       "6                      拌匀放入碗中压实   \n",
       "7                 扣上个盘，在倒扣过来去掉碗   \n",
       "8          撒少许白芝麻盐即可（没有白芝麻可以省略）   \n",
       "\n",
       "                                                 pic  \n",
       "0  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "1  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "2  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "3  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "4  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "5  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "6  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "7  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  \n",
       "8  http:\\/\\/api.jisuapi.com\\/recipe\\/upload\\/2016...  "
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#步骤\n",
    "pd.json_normalize(df5['process'][0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
